import axios from '@/libs/api.request'

// =============== parameters/components/basic.vue =========================
export const getBasicParams = () => {
  return axios.request({
    url: '/api/admin/params/basic',
    method: 'get'
  })
}

export const getOperateParams = () => {
  return axios.request({
    url: '/api/admin/params/operates',
    method: 'get'
  })
}

// =============== parameters/list.vue =========================

export const saveBasic = (basicForm) => {
  return axios.request({url: '/api/admin/params/basic', data: basicForm, method: 'post'})
}

export const saveOperate = (basicForm) => {
  return axios.request({url: '/api/admin/params/operates', data: basicForm, method: 'post'})
}




// =============== operates/list.vue =========================

export const add = (formData) => {
  return axios.request({url: '/api/admin/cars', data: formData, method: 'post'})
}

export const edit = (id, formData) => {
  return axios.request({
    url: '/api/admin/users/' + id,
    data: formData,
    method: 'patch'
  })
}

export const getInfoById = (id) => {
  return axios.request({
    url: 'api/admin/users/' + id,
    method: 'get'
  })
}
